write up ctf by ariafatah

ariaf.my.id/ctf_aria/general/M_ASCII Numbers.html


soal

Convert the following string of ASCII numbers into a readable string:

0x70 0x69 0x63 0x6f 0x43 0x54 0x46 0x7b 0x34 0x35 0x63 0x31 0x31 0x5f 0x6e 0x30 0x5f 0x71 0x75 0x33 0x35 0x37 0x31 0x30 0x6e 0x35 0x5f 0x31 0x6c 0x6c 0x5f 0x74 0x33 0x31 0x31 0x5f 0x79 0x33 0x5f 0x6e 0x30 0x5f 0x6c 0x31 0x33 0x35 0x5f 0x34 0x34 0x35 0x64 0x34 0x31 0x38 0x30 0x7d

hint

  • CyberChef is a great tool for any encoding but especially ASCII.
  • Try CyberChef’s ‘From Hex’ function

solve

cat > teks << EOF
0x70 0x69 0x63 0x6f 0x43 0x54 0x46 0x7b 0x34 0x35 0x63 0x31 0x31 0x5f 0x6e 0x30 0x5f 0x71 0x75 0x33 0x35 0x37 0x31 0x30 0x6e 0x35 0x5f 0x31 0x6c 0x6c 0x5f 0x74 0x33 0x31 0x31 0x5f 0x79 0x33 0x5f 0x6e 0x30 0x5f 0x6c 0x31 0x33 0x35 0x5f 0x34 0x34 0x35 0x64 0x34 0x31 0x38 0x30 0x7d
EOF

cat teks | sed "s/0x//g"
# 70 69 63 6f 43 54 46 7b 34 35 63 31 31 5f 6e 30 5f 71 75 33 35 37 31 30 6e 35 5f 31 6c 6c 5f 74 33 31 31 5f 79 33 5f 6e 30 5f 6c 31 33 35 5f 34 34 35 64 34 31 38 30 7d

cat teks | sed "s/0x//g" | tr -d " "
# 7069636f4354467b34356331315f6e305f717533353731306e355f316c6c5f743331315f79335f6e305f6c3133355f34343564343138307d

cat teks | sed "s/0x//g" | tr -d " " | python2 -c "print(raw_input())"
# 7069636f4354467b34356331315f6e305f717533353731306e355f316c6c5f743331315f79335f6e305f6c3133355f34343564343138307d

cat teks | sed "s/0x//g" | tr -d " " | python2 -c "print(raw_input().decode('hex'))"
# picoCTF{45c11_n0_qu35710n5_1ll_t311_y3_n0_l135_445d4180}

sed

sed 's/pola/pengganti/opsi' file
echo "halo aria, halo vido, halo ariafatah" | sed "s/halo/hi/" # hanya teks pertamaa saja
# hi aria, halo vido, halo ariafatah

echo "halo aria, halo vido, halo ariafatah" | sed "s/halo/hi/g" # semua teks
# hi aria, hi vido, hi ariafatah

echo "halo aria, halo vido, halo ariafatah" | sed "s/halo//g" # jika pengganti tidak di tulis maka akan kosong
# aria,  vido,  ariafatah

flag

picoCTF{45c11_n0_qu35710n5_1ll_t311_y3_n0_l135_445d4180}